#!/bin/sh
lock() {
    slock
}

case "$1" in
    lock)
        /usr/bin/slock &
        ;;
    logout)
        i3-msg exit
        ;;
    suspend)
	/usr/local/bin/susp
        ;;
    reboot)
	password=$(zenity --title Exit --password --text "Introduce tu contraseña:")
	echo -n $password | sudo --stdin reboot
        ;;
    shutdown)
	password=$(zenity --title Exit --password --text "Introduce tu contraseña:")
	echo -n $password | sudo --stdin poweroff
        ;;
    *)
        echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
        exit 2
esac

exit 0
